package com.yswy.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.yswy.domain.common.BasePojo;
import com.yswy.domain.entity.user.User;
import com.yswy.domain.vo.gld.addOrUpate.DomainAddOrUpdate;
import com.yswy.domain.vo.gld.addOrUpate.SoftnessAddOrUpdate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@Api(tags = "域名管理")
@TableName(value = "domain")
public class Domain extends BasePojo<Domain> {
    @ApiModelProperty("域名")
    private String domainName;
    @ApiModelProperty("绑定账户")
    private String serviceAccount;
    @ApiModelProperty("使用范围")
    private String usdRange;
    @ApiModelProperty("证书到期时间")
    private Date expirationTime;

    public Domain(DomainAddOrUpdate res, User user){
        this.domainName =res.getDomainName();
        this.serviceAccount =res.getServiceAccount();
        this.usdRange =res.getUsdRange();
        this.expirationTime =res.getExpirationTime();
        super.setCreateBy(user.getId().longValue());
    }
    public Domain(){

    }
}
